/**
 * webpack.dev.js
 */
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const path = require('path');

module.exports = {
  mode: 'development',  // 打包模式
  devtool: 'source-map', // 以何种方式配置source-map
  target: 'web',  // 默认值web，开发阶段屏蔽掉.browserslist文件
  devServer: {
    hot: true,  // 热更新
    compress: true, // 压缩
    proxy: {
      '/api': {
        target: 'https://api.github.com',
        changeorigin: true,
        pathRewrite: { '^/api': '' }
      }
    },
  },
  plugins: [
    new ReactRefreshWebpackPlugin()
  ]
}